/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package multitrack.preload;

import java.io.IOException;
import java.io.InputStream;

/**
 *
 * @author pyw
 */
class SpyInputStream extends InputStream {

    final InputStream openStream;

    public SpyInputStream(InputStream openStream) {
        this.openStream = openStream;
    }

    public long skip(long n) throws IOException {  
        System.out.println("skip "+n);
        return openStream.skip(n);
    }

    public synchronized void reset() throws IOException {
        System.out.println("reset");
        openStream.reset();
    }

    public int read(byte[] b, int off, int len) throws IOException {
        System.out.println("read "+off+" "+len);
        return openStream.read(b, off, len);
    }

    public int read(byte[] b) throws IOException {
        System.out.println("read "+b.length);
        return openStream.read(b);
    }

    public int read() throws IOException {
        System.out.println("read");
        return openStream.read();
    }

    public boolean markSupported() {
        System.out.println("markSupported");
        return openStream.markSupported();
    }

    public synchronized void mark(int readlimit) {
        System.out.println("mark "+readlimit);
        openStream.mark(readlimit);
    }

    public void close() throws IOException {
        System.out.println("close");
        openStream.close();
    }

    public int available() throws IOException {
        System.out.println("available");
        return openStream.available();
    }

  
}
